/*
 * Vector.hpp
 *
 *  Created on: 21-11-2010
 *      Author: Przemek
 */

#pragma once

/*
 * A two dimensional Cartesian vector based on floating point numbers. Can be used as a point.
 */
class Vector
{
	private:
		float x;
		float y;

	public:
		explicit Vector(float x = 0.0f, float y = 0.0f);
		Vector(int x, int y);
		Vector(const Vector& other);

		float getX() const;
		void setX(float x);
		void setX(int x);

		float getY() const;
		void setY(float y);
		void setY(int y);

		void set(const Vector& other);

		float getSquaredLength() const;
		float getLength() const;
		float getAngleInRadians() const;
		float getCos(const Vector& other) const;

		Vector normalize() const;

		Vector operator-() const;
		Vector operator+(const Vector& other) const;
		Vector operator-(const Vector& other) const;
		Vector operator*(const float value) const;
		Vector operator/(const float value) const;

		Vector& operator+=(const Vector& other);
		Vector& operator-=(const Vector& other);
		Vector& operator*=(const float value);
		Vector& operator/=(const float value);

		Vector& operator=(const Vector& other);
		bool operator==(const Vector& other) const;
		bool operator!=(const Vector& other) const;
};
